#include <iostream>
#include <memory>

#include "selectserver3.hpp"

using namespace std;
using namespace select_ns;

static void usage(std::string proc){
    std::cerr << "usage:\n\t" << proc << " port" << "\n\n";
}

std::string transaction(const std::string& request){
    std::cout << request << std::endl;
    return request;
}

int main(int argc, char* argv[]){
    // if(argc != 2){
    //     usage(argv[0]);
    //     exit(USAGE_ERR);
    // }

    // std::cout << sizeof(fd_set) * 8 << std::endl;  // 1024

    unique_ptr<SelectServer> svr(new SelectServer(transaction));

    svr->initServer();

    svr->start();

    return 0;
}